package com.you.concurrent.juc.condition;

import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class Main {

    public static void main(String[] args) {
        Lock lock = new ReentrantLock();
        Condition condition = lock.newCondition();
        //等待线程
        new Thread(() -> {
            new ConditionWaitDemo(lock, condition).conditionWaitMethod();
        }).start();
        //通知线程
        new Thread(() -> {
            new ConditionSignalDemo(lock, condition).conditionSignalMethod();
        }).start();
    }
}
